#include <QtGui>
#include "CustomConvertor.h"

#include <VolumeViz/nodes/SoVolumeRendering.h>
#include <LDM/converters/SoConverterParameters.h>
#include <VolumeViz/converters/SoVolumeConverter.h>
#include <Inventor/devices/SoCpuDevice.h>
int main(int argc, char *argv[])
{
  QApplication a(argc, argv);

  QProgressBar progressDialog;
  progressDialog.show();

  CustomConvertor hConvert;
  QObject::connect( &hConvert, SIGNAL( progressChanged( int ) ), &progressDialog, SLOT( setValue( int ) ) );

  SoCpuDevice::initClass();
  SoVolumeRendering::init();

  char* my_argv[] = {
    "Converter",
    "E:/ynnewdat.sgy",
    "-b",
    "-t",
    "128"
  };
  int my_argc = sizeof(my_argv)/sizeof(char*);

  SoConverterParameters* myConverterParameters = SoConverterParameters::create( my_argc, my_argv );
  int ret = 1;
  if( myConverterParameters )
  {
    myConverterParameters->setTileDim(128);
    ret = hConvert.convert( myConverterParameters );
    delete myConverterParameters;
  }

  a.exec();
  SoVolumeRendering::finish();

  return 0;
}
